package apptoko.com;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

import com.google.android.gms.plus.PlusShare;

public class HandleDeepLinkActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		String deepLinkId = PlusShare.getDeepLinkId(this.getIntent());
		Intent deepLinkTarget = parseDeepLinkId(deepLinkId);
		startActivity(deepLinkTarget);
		finish();
	}
	
	private Intent parseDeepLinkId(String linkId){
		Intent intent = new Intent(Intent.ACTION_VIEW);
		intent.setData(Uri.parse(linkId));
		return intent;
	}
}
